package  com.pcbly.web.business.system;

/**
* @author carl.song
* Copyright (c) 2010 Lightsoft, International.
* All rights reserved.
*
*/

import java.util.List;

import com.pcbly.web.persistence.system.ModuleDao;
import com.pcbly.web.bean.system.ModuleBean;
import com.pcbly.web.business.BaseServiceImp;
import com.pcbly.web.components.hibernate.support.Page;

 
public class ModuleServiceImp extends BaseServiceImp<ModuleBean> implements ModuleService {
	 public ModuleServiceImp() {
		super();
		// TODO Auto-generated constructor stub
	}
	private ModuleDao moduleDao;
	
	public void setModuleDao(ModuleDao moduleDao) {
		this.moduleDao = moduleDao;
	}
	
	@Override
	public ModuleBean getModuleBeanById(String id) throws Exception {
		// TODO Auto-generated method stub
		return moduleDao.get(ModuleBean.class,id);
	}
	
	@Override
	public void removeModuleBeanById(String id) throws Exception{
		moduleDao.removeModuleBeanById(id);
	}
	
	@Override
	public void removeModuleBeanByIds(String ids) throws Exception{
		moduleDao.removeModuleBeanByIds(ids);
	}
	
	
	@Override
	public ModuleBean saveModuleBean(ModuleBean system) throws Exception{
		return moduleDao.saveModuleBean(system);
	}
	
	@Override
	public ModuleBean updateModuleBean(ModuleBean system) throws Exception{
		moduleDao.saveObject( system);
		return system;
	}
	public Page<ModuleBean>  findModuleBeanByCond(ModuleBean bean,
			Page<ModuleBean> page, String orderByName, boolean asc)
			throws Exception{
		return moduleDao.findModuleBeanByCond(
				bean, page, orderByName, asc);
	}

	@Override
	public List<ModuleBean> findModuleBeansByCond(String menuId)
			throws Exception {
		// TODO Auto-generated method stub
		return moduleDao.findModuleBeansByCond(menuId);
	}
}
